package cn.edu.zzu.demo01Thread;

public class TestJoinThread06 implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName() + " VIP! "+i);
        }
    }

    public static void main(String[] args) throws InterruptedException {
        //vip线程
        TestJoinThread06 testJoinThread06 = new TestJoinThread06();
        Thread t1 = new Thread(testJoinThread06, "特权");
        t1.start();

        for (int i = 0; i < 50; i++) {
            if (i==20){
                t1.join();
            }
            System.out.println(Thread.currentThread().getName()+" 执行了 "+i);
        }
    }
}
